home *** CD-ROM | disk | FTP | other *** search
- /*
- A basic extension of the java.awt.Frame class
- */
-
- import java.awt.*;
-
- public class Frame1 extends Frame {
-
- public Frame1() {
-
- //{{INIT_CONTROLS
- setLayout(null);
- addNotify();
- resize(insets().left + insets().right + 400,insets().top + insets().bottom + 300);
- setTitle("A Simple Frame");
- //}}
-
- //{{INIT_MENUS
- //}}
- }
-
- public Frame1(String title) {
- this();
- setTitle(title);
- }
-
- public synchronized void show() {
- move(50, 50);
- super.show();
- }
-
- public boolean handleEvent(Event event) {
- if (event.id == Event.WINDOW_DESTROY) {
- hide(); // hide the Frame
- return true;
- }
- return super.handleEvent(event);
- }
-
- //{{DECLARE_CONTROLS
- //}}
-
- //{{DECLARE_MENUS
- //}}
- }
-